package br.com.linkideias.model.command.turno;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.hibernate.Session;
import br.com.linkideias.model.bean.Periodo;
import br.com.linkideias.model.command.InterfaceCommand;
import br.com.linkideias.model.dao.HibernateDAO;
import br.com.linkideias.model.dao.InterfaceDAO;
import br.com.linkideias.util.HibernateUtil;


public class ConsultarTurno implements InterfaceCommand {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) {
		InterfaceDAO<Periodo> turnoDAO = new HibernateDAO<Periodo>(Periodo.class, (Session)request.getAttribute(HibernateUtil.HIBERNATE_SESSION));
		List<Periodo> turnos = turnoDAO.getBeans();
		request.setAttribute("turnos", turnos);
		return "consulta_turno.jsp";
	}

}
